package com.kingdee.eas.custom.bpmworkflow.base;

import javax.ejb.*;
import java.rmi.RemoteException;
import com.kingdee.bos.*;
import com.kingdee.bos.util.BOSObjectType;
import com.kingdee.bos.metadata.IMetaDataPK;
import com.kingdee.bos.metadata.rule.RuleExecutor;
import com.kingdee.bos.metadata.MetaDataPK;
//import com.kingdee.bos.metadata.entity.EntityViewInfo;
import com.kingdee.bos.framework.ejb.AbstractEntityControllerBean;
import com.kingdee.bos.framework.ejb.AbstractBizControllerBean;
//import com.kingdee.bos.dao.IObjectPK;
import com.kingdee.bos.dao.IObjectValue;
import com.kingdee.bos.dao.IObjectCollection;
import com.kingdee.bos.service.ServiceContext;
import com.kingdee.bos.service.IServiceContext;
import com.kingdee.eas.framework.Result;
import com.kingdee.eas.framework.LineResult;
import com.kingdee.eas.framework.exception.EASMultiException;
import com.kingdee.bos.dao.ormapping.ObjectUuidPK;

import java.lang.String;



public abstract class AbstractBaseRequestFacadeControllerBean extends AbstractBizControllerBean implements BaseRequestFacadeController
{
    protected AbstractBaseRequestFacadeControllerBean()
    {
    }

    protected BOSObjectType getBOSType()
    {
        return new BOSObjectType("DC3CDE03");
    }

    public String createBillXML(Context ctx, String billId, String type) throws BOSException
    {
        try {
            ServiceContext svcCtx = createServiceContext(new MetaDataPK("181eadd7-781b-4839-a558-44dc1c24cb2f"), new Object[]{ctx, billId, type});
            invokeServiceBefore(svcCtx);
            if(!svcCtx.invokeBreak()) {
            String retValue = (String)_createBillXML(ctx, billId, type);
            svcCtx.setMethodReturnValue(retValue);
            }
            invokeServiceAfter(svcCtx);
            return (String)svcCtx.getMethodReturnValue();
        } catch (BOSException ex) {
            throw ex;
        } finally {
            super.cleanUpServiceState();
        }
    }
    protected String _createBillXML(Context ctx, String billId, String type) throws BOSException
    {    	
        return null;
    }

    public String startBPMWorkFlow(Context ctx, String billId, String type) throws BOSException
    {
        try {
            ServiceContext svcCtx = createServiceContext(new MetaDataPK("2d339505-fb16-45cf-8aee-e39597527254"), new Object[]{ctx, billId, type});
            invokeServiceBefore(svcCtx);
            if(!svcCtx.invokeBreak()) {
            String retValue = (String)_startBPMWorkFlow(ctx, billId, type);
            svcCtx.setMethodReturnValue(retValue);
            }
            invokeServiceAfter(svcCtx);
            return (String)svcCtx.getMethodReturnValue();
        } catch (BOSException ex) {
            throw ex;
        } finally {
            super.cleanUpServiceState();
        }
    }
    protected String _startBPMWorkFlow(Context ctx, String billId, String type) throws BOSException
    {    	
        return null;
    }

    public String stopBPMWorkFlow(Context ctx, String billId) throws BOSException
    {
        try {
            ServiceContext svcCtx = createServiceContext(new MetaDataPK("b11474b9-4777-4d05-9609-7a12aa3bd46a"), new Object[]{ctx, billId});
            invokeServiceBefore(svcCtx);
            if(!svcCtx.invokeBreak()) {
            String retValue = (String)_stopBPMWorkFlow(ctx, billId);
            svcCtx.setMethodReturnValue(retValue);
            }
            invokeServiceAfter(svcCtx);
            return (String)svcCtx.getMethodReturnValue();
        } catch (BOSException ex) {
            throw ex;
        } finally {
            super.cleanUpServiceState();
        }
    }
    protected String _stopBPMWorkFlow(Context ctx, String billId) throws BOSException
    {    	
        return null;
    }

    public void saveBPMWorkFlow(Context ctx, String billId, String procInstId, String procURL, String success) throws BOSException
    {
        try {
            ServiceContext svcCtx = createServiceContext(new MetaDataPK("31581b20-e4a0-4663-b1f7-e09d5d3ae834"), new Object[]{ctx, billId, procInstId, procURL, success});
            invokeServiceBefore(svcCtx);
              if(!svcCtx.invokeBreak()) {
            _saveBPMWorkFlow(ctx, billId, procInstId, procURL, success);
            }
            invokeServiceAfter(svcCtx);
        } catch (BOSException ex) {
            throw ex;
        } finally {
            super.cleanUpServiceState();
        }
    }
    protected void _saveBPMWorkFlow(Context ctx, String billId, String procInstId, String procURL, String success) throws BOSException
    {    	
        return;
    }

    public String viewBPMWorkFlow(Context ctx, String billid) throws BOSException
    {
        try {
            ServiceContext svcCtx = createServiceContext(new MetaDataPK("71e6965f-d6ed-41a3-ab23-a20e7b42ac92"), new Object[]{ctx, billid});
            invokeServiceBefore(svcCtx);
            if(!svcCtx.invokeBreak()) {
            String retValue = (String)_viewBPMWorkFlow(ctx, billid);
            svcCtx.setMethodReturnValue(retValue);
            }
            invokeServiceAfter(svcCtx);
            return (String)svcCtx.getMethodReturnValue();
        } catch (BOSException ex) {
            throw ex;
        } finally {
            super.cleanUpServiceState();
        }
    }
    protected String _viewBPMWorkFlow(Context ctx, String billid) throws BOSException
    {    	
        return null;
    }

    public void updateBillState(Context ctx, String billId, int state, String auditorNum) throws BOSException
    {
        try {
            ServiceContext svcCtx = createServiceContext(new MetaDataPK("483296fe-510d-49a2-8921-2d99d2eb6dea"), new Object[]{ctx, billId, new Integer(state), auditorNum});
            invokeServiceBefore(svcCtx);
              if(!svcCtx.invokeBreak()) {
            _updateBillState(ctx, billId, state, auditorNum);
            }
            invokeServiceAfter(svcCtx);
        } catch (BOSException ex) {
            throw ex;
        } finally {
            super.cleanUpServiceState();
        }
    }
    protected void _updateBillState(Context ctx, String billId, int state, String auditorNum) throws BOSException
    {    	
        return;
    }

}